@extends('home.base.user')

@section('content')
<div class="content container">
    <!--删除-->
    <form action="/home/favorites" method="post" name="myform">
        <input type="hidden" name="_token" value="{{csrf_token()}}">
        <input type="hidden" name="_method" value="DELETE">
    </form>
    <div class="f_l personal_l">
        <div class="personal_l_b"></div>
    </div><!--personal_l end-->
    <div class="f_r personal_r">
        <div class="personal_r_t"></div>
        <div class="personal_r_m">
            <div class="personal_r_m_t coll_t">
                <h2>我的收藏夹</h2>
            </div><!--personal_r_m_t end-->
            <div class="personal_r_m_m ">
                <div class="blank10"></div>
                <div class="coll_m">
                    <table width="100%">
                        <thead>
                            <tr>
                                <th class="first" width="45%">商品</th><th width="15%">单价</th><th width="22%">放入时间</th><th width="18%">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach ($goods as $v)
                            <tr>
                                <td class="first">
                                    <a href="#"><img src="{{asset('/uploads'.'/'.$v->pic)}}" class="p_img" /></a>
                                    <a href="#" class="blue">{{$v->goodname}}</a>
                                </td>
                                <td><span class="red">{{$v->price}}</span></td>
                                <td><span></span>{{$v->time}}</td>
                                <td><a href="/home/goods/{{$v->gid}}" class="blue">[购买]</a> | <a href="javascript:doDel({{$v->gid}})" class="btn" class="red">[删除]</a></td>
                            </tr>
                         @endforeach
                        </tbody>
                    </table>
                    <script type="text/javascript">
                        function doDel(gid)
                        {
                            if(confirm("确定要删除吗？")){
                                var form = document.myform;
                                form.action = "favorites/"+gid;
                                form.submit()
                            }
                        }
                    </script>
                </div><!--coll_m end-->
            </div><!--comment end-->
        </div><!--personal_r_m end-->
        <div class="personal_r_b"></div>
    </div><!--personal_r end-->

    <div class="clear mb-10"></div>

 @stop
